﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
dim myid
myid=qingtian.nid
%>

<card title="王五药铺">
<p>
<%

ids=myid
wpid=request("wid")


if wpid="1" then
yname="百草丹"
xyyz="100"
tname="y1"

elseif wpid="2" then
yname="大力神丹"
xyyz="200"
tname="y2"

elseif wpid="3" then
yname="九转还魂丹"
xyyz="500"
tname="y3"

elseif wpid="4" then
xyyz="1000"
yname="少林大还丹"
tname="y4"
else
xyyz="100000"
yname="江湖强力魔水"
tname="y5"
end if
if request("caozuo")<>"ok" then
Response.Write "王五："&yname&"每颗"&xyyz&"两，您要多少<br/>"
%>
我说：拿<input name="num" size="3" format="*N"/>
<anchor>颗给我吧！
<go method="post" href="yao1.asp?cc=<%=cc%>&amp;ve=<%=ve%>">
<postfield name="wid" value="<%=wpid%>"/>
<postfield name="num" value="$(num)"/>
<postfield name="caozuo" value="ok"/>
</go></anchor><br/>
<%
else

set rs=Server.CreateObject("ADODB.Recordset")
strsQL="select yz from wupin where cstr(ids)='"&myid& "'"
rs.open strsQL,liao,1,1
num=clng(request("num"))
xycp=clng(xyyz)*num
if clng(xycp)>rs("yz") then
msg="您的银两不够购买"&num&"颗"&yname&"！快去赚一点吧！"
else
sql="update wupin set "&tname&"="&tname&"+"&num&" where cstr(ids)="&myid
  liao.Execute(sql)
sql="update wupin set yz=yz-"&xycp&" where cstr(ids)="&myid
  liao.Execute(sql)
msg="您花"&xycp&"两银两购买了"&num&"颗"&yname&".<br/><a href='yao.asp?cc="&cc&"&amp;ve="&ve&"'>继续交易</a>"
end if
Response.Write ""&msg&"<br/>=========<br/>"
 rs.Close
	Set rs=Nothing
end if
     
      
%>
<a href="index.asp?cc=<%=cc%>&amp;ve=<%=ve%>">江湖首页</a><br/>

<%qingtian.shuchu%>

